package com.kk.controller;

import com.kk.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
public class UserController {

    @RequestMapping("/user")
    public ModelAndView addUser(User user,@RequestParam List<String> hobby) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("user",user);
        modelAndView.addObject("list",hobby);
        modelAndView.setViewName("/WEB-INF/pages/user.jsp");
        return modelAndView;
    }
}
